package com.xianchao.comminlibrary.utils;

/**
 * Created by Administrator on 2016/11/30.
 */

public class StringUtils {


    /**
     *
     * @param str
     * @return
     */
    public static boolean isInt(String str){
        try{
            int i = Integer.parseInt(str);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
    /**
     *
     * @param str
     * @return
     */
    public static boolean isLong(String str){
        try{
            Long.parseLong(str);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
    /**
     *
     * @param str
     * @return
     */
    public static boolean isBoolean(String str){
        try{
            Boolean.parseBoolean(str);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
    /**
     *
     * @param str
     * @return
     */
    public static boolean isFloat(String str){
        try{
            Float.parseFloat(str);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
    /**
     *
     * @param str
     * @return
     */
    public static boolean isDouble(String str){
        try{
            Double.parseDouble(str);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
}
